import FooterCom from '@/components/FooterCom.vue'
import FindIndex from '@/views/find/findIndex.vue'
import HomeIndex from '@/views/home/homeIndex.vue'
import MessageIndex from '@/views/message/messageIndex.vue'
import PostIndex from '@/views/post/postIndex.vue'
import { createRouter, createWebHashHistory } from 'vue-router'


const router = createRouter({
    history: createWebHashHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            redirect: '/home',
        },
        {
            path: '/home',
            name: 'home',
            components: {
                default: HomeIndex,
                FooterCom
            }
        },
        {
            path: '/find',
            name: 'find',
            components: {
                default: FindIndex,
                FooterCom
            }
        },
        {
            path: '/post',
            name: 'post',
            component: PostIndex
            // components: {
            //     default: PostIndex,
            //     FooterCom
            // },
        },
        {
            path: '/message',
            name: 'message',
            components: {
                default: MessageIndex,
                FooterCom
            },
        },
        {
            path: '/my',
            name: 'my',
            components: {
                default: () => import('@/views/my/myIndex.vue'),
                FooterCom
            },
        }, {
            path: '/homeShow',
            name: 'homeShow',
            component: () => import('@/views/home/homeShow.vue'),
        },
        {
            path: '/homeTag',
            name: 'homeTag',
            component: () => import('@/views/home/homeTag.vue'),
        },
        {
            path: '/login',
            name: 'login',
            component: () => import('@/views/login/loginIndex.vue'),
        },
        {
            path: '/register',
            name: 'register',
            component: () => import('@/views/register/registerIndex.vue'),
            children: [
                {
                    path: 'step1',
                    name: 'step1',
                    component: () => import('@/views/register/step1.vue')
                },
                {
                    path: 'step2',
                    name: 'step2',
                    component: () => import('@/views/register/step2.vue')
                },
                {
                    path: 'step3',
                    name: 'step3',
                    component: () => import('@/views/register/step3.vue')
                }
            ],
            redirect: '/register/step1'
        },
        {
            path: '/changeInfo',
            name: 'changeInfo',
            component: () => import('@/views/my/changeInfo.vue')
        },
        {
            path: '/changePassword',
            name: 'changePassword',
            component: () => import('@/views/my/changePassword.vue')
        },
        {
            path: '/topic',
            name: 'topic',
            component: () => import('@/views/find/topic.vue')
        },
        {
            path: '/postShow',
            name: 'postShow',
            component: () => import('@/views/find/postShow.vue')
        },
        {
            path: '/comments',
            name: 'comments',
            component: () => import('@/views/message/comments.vue')
        },
        {
            path: '/fans',
            name: 'fans',
            component: () => import('@/views/message/fans.vue')
        },
        {
            path: '/liked',
            name: 'liked',
            component: () => import('@/views/message/liked.vue')
        },
        {
            path: '/messages',
            name: 'messages',
            component: () => import('@/views/message/messages.vue')
        },
        {
            path: '/myLike',
            name: 'myLike',
            component: () => import('@/views/my/myLike.vue')
        },
        {
            path: '/myCollect',
            name: 'myCollect',
            component: () => import('@/views/my/myCollect.vue')
        },
        {
            path: '/history',
            name: 'history',
            component: () => import('@/views/my/history.vue')
        },
        {
            path: '/myFans',
            name: 'myFans',
            component: () => import('@/views/my/myFans.vue')
        },
        {
            path: '/myConcern',
            name: 'myConcern',
            component: () => import('@/views/my/myConcern.vue')
        },
        {
            path: '/myPost',
            name: 'myPost',
            component: () => import('@/views/my/myPost.vue')
        },
    ],
})

export default router
